package com.atguigu.es.vo;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

@Data
@Document(indexName = "atguigu")
public class Product {
    @Id
    private Long id;
    @Field(value = "title" , type = FieldType.Text , analyzer = "ik_max_word")
    private String title;
    @Field(value = "images" , type = FieldType.Keyword , index = false)
    private String images;
    @Field(value = "price" , type = FieldType.Long )
    private Long price;
    @Field(value = "stock" , type = FieldType.Long)
    private Long stock;
    @Field(value = "attr" , type = FieldType.Object)
    private Attr attr;

}
